Imports System.Windows.Forms
Imports System.Data.OracleClient

Public Class frmMDI

  Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a new instance of the child form.
    Dim ChildForm As New System.Windows.Forms.Form
    ' Make it a child of this MDI form before showing it.
    ChildForm.MdiParent = Me

    m_ChildFormNumber += 1
    ChildForm.Text = "Window " & m_ChildFormNumber

    ChildForm.Show()
  End Sub

 
    Private m_ChildFormNumber As Integer = 0

  Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object _
                                       , ByVal e As System.EventArgs _
                                       ) Handles mnuAddTabl.Click

    'Dim lObjFrmDBEntry As New frmDBEntry
    frmTableDesign.MdiParent = Me
    frmTableDesign.Show()

    'frmDBEntry.MdiParent = Me
    'frmDBEntry.Show()
  End Sub

  Private Sub frmMDI_Load(ByVal sender As Object _
                        , ByVal e As System.EventArgs) Handles Me.Load

    mFnReadValue("DatabaseDSN", String.Empty, String.Empty, mPrpDatabase, Application.StartupPath + "\" + CONFIG_FILE)
    mFnReadValue("DatabaseUserID", String.Empty, String.Empty, mPrpUserName, Application.StartupPath + "\" + CONFIG_FILE)
    mFnReadValue("DatabasePassword", String.Empty, String.Empty, mPrpPassword, Application.StartupPath + "\" + CONFIG_FILE)
    mPrpConnString = "User Id=" + mPrpUserName + ";Data Source=" + mPrpDatabase + ";persist security info=true;Password=" + mPrpPassword

    DBConnect()

  End Sub


  Private Sub mnuAddLxcn_Click(ByVal sender As System.Object _
                             , ByVal e As System.EventArgs) Handles mnuAddLxcn.Click

    Dim lObjFrmAddMdfyDctnry As frmDctnryAddMdfy

    lObjFrmAddMdfyDctnry = frmDctnryAddMdfy.mFnGetInstance()
    lObjFrmAddMdfyDctnry.MdiParent = Me
    lObjFrmAddMdfyDctnry.Show()

  End Sub

  Private Sub mnuGnrtFile_Click(ByVal sender As System.Object _
                              , ByVal e As System.EventArgs) Handles mnuGnrtFile.Click

    Dim lObjFrmDsgnrGnrtr As New frmDsgnrGnrtr

    lObjFrmDsgnrGnrtr.MdiParent = Me

    lObjFrmDsgnrGnrtr.Show()

  End Sub

  Private Sub mnuMsgStruct_Click(ByVal sender As System.Object _
                             , ByVal e As System.EventArgs) Handles mnuMsgStruct.Click

    Dim lObjFrmStrucGnrtrMain As New frmMain

    lObjFrmStrucGnrtrMain.MdiParent = Me

    lObjFrmStrucGnrtrMain.Show()

  End Sub

  
  Private Sub mnuAddVar_Click(ByVal sender As System.Object _
                                                          , ByVal e As System.EventArgs) _
                                                            Handles mnuAddVar.Click

    frmGnrVar.MdiParent = Me
    frmGnrVar.Show()
  End Sub

  Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click

    frmIndexGenretor.MdiParent = Me
    frmIndexGenretor.Show()
  End Sub

  Private Sub GeneratorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GeneratorToolStripMenuItem.Click

    frmGenerator.MdiParent = Me
    frmGenerator.Show()
  End Sub

  Private Sub ForeignKeyEditorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ForeignKeyEditorToolStripMenuItem.Click
    frmForeignKeyGenretor.MdiParent = Me
    frmForeignKeyGenretor.Show()
  End Sub

  Private Sub ReportViewerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReportViewerToolStripMenuItem.Click
    Dim lObjReportViewer As New frmReportViewer
    lObjReportViewer.MdiParent = Me
    lObjReportViewer.Show()
  End Sub

  Private Sub TamplateEditorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TamplateEditorToolStripMenuItem.Click
    Dim lObjTemplateEditor As New frmTemplateEditor
    lObjTemplateEditor.MdiParent = Me
    lObjTemplateEditor.Show()
  End Sub

  Private Sub ManageCategoryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ManageCategoryToolStripMenuItem.Click
    frmManageCategory.MdiParent = Me
    frmManageCategory.Show()
  End Sub

End Class
